/**
 * 
 */
package cn.edu.cqu.bysj.wm.gui.component;

import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextPane;
import javax.swing.LayoutStyle.ComponentPlacement;
import java.awt.BorderLayout;
import java.awt.SystemColor;
import java.awt.Color;

/**
 * @author Meng
 * 
 */
public class LPSQAlgorithmResultContent extends JPanel {
	private JTextPane totalTime;
	private JTextPane initialTime;
	private JTextPane iterationTime;
	private JTextPane QValue;
	private JPanel communityResult;

	/**
	 * create lp algorithm result cotent
	 */
	public LPSQAlgorithmResultContent() {
		JPanel panel = new JPanel();

		JLabel label = new JLabel("Total Time");
		label.setForeground(new Color(65, 105, 225));

		totalTime = new JTextPane();
		totalTime.setBackground(SystemColor.menu);
		totalTime.setEditable(false);

		JLabel label_1 = new JLabel("Initial Time");
		label_1.setForeground(new Color(65, 105, 225));

		initialTime = new JTextPane();
		initialTime.setBackground(SystemColor.menu);
		initialTime.setEditable(false);

		JLabel label_2 = new JLabel("Iteration Time");
		label_2.setForeground(new Color(65, 105, 225));

		iterationTime = new JTextPane();
		iterationTime.setBackground(SystemColor.menu);
		iterationTime.setEditable(false);

		JLabel lblQValue = new JLabel("Q Value");
		lblQValue.setForeground(new Color(255, 140, 0));

		QValue = new JTextPane();
		QValue.setBackground(SystemColor.menu);
		QValue.setEditable(false);

		communityResult = new JPanel();
		GroupLayout groupLayout = new GroupLayout(this);
		groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(
				Alignment.TRAILING).addGroup(
				Alignment.LEADING,
				groupLayout
						.createSequentialGroup()
						.addGap(5)
						.addGroup(
								groupLayout
										.createParallelGroup(Alignment.LEADING)
										.addComponent(panel,
												GroupLayout.PREFERRED_SIZE,
												1228, Short.MAX_VALUE)
										.addComponent(communityResult,
												GroupLayout.DEFAULT_SIZE, 1237,
												Short.MAX_VALUE))
						.addContainerGap()));
		groupLayout.setVerticalGroup(groupLayout.createParallelGroup(
				Alignment.LEADING).addGroup(
				groupLayout
						.createSequentialGroup()
						.addGap(6)
						.addComponent(panel, GroupLayout.PREFERRED_SIZE, 54,
								GroupLayout.PREFERRED_SIZE)
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(communityResult,
								GroupLayout.DEFAULT_SIZE, 398, Short.MAX_VALUE)
						.addGap(5)));

		JLabel label_4 = new JLabel("               ");

		JLabel label_5 = new JLabel("            ");

		JLabel label_3 = new JLabel("");
		GroupLayout gl_panel = new GroupLayout(panel);
		gl_panel.setHorizontalGroup(gl_panel.createParallelGroup(
				Alignment.LEADING).addGroup(
				gl_panel.createSequentialGroup()
						.addGap(4)
						.addComponent(label, GroupLayout.PREFERRED_SIZE, 80,
								GroupLayout.PREFERRED_SIZE)
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(totalTime, GroupLayout.PREFERRED_SIZE,
								107, GroupLayout.PREFERRED_SIZE)
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(label_4, GroupLayout.PREFERRED_SIZE, 138,
								GroupLayout.PREFERRED_SIZE)
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(label_1)
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(initialTime, GroupLayout.PREFERRED_SIZE,
								109, GroupLayout.PREFERRED_SIZE)
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(label_5)
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(label_2, GroupLayout.PREFERRED_SIZE, 112,
								GroupLayout.PREFERRED_SIZE)
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(iterationTime,
								GroupLayout.PREFERRED_SIZE, 98,
								GroupLayout.PREFERRED_SIZE)
						.addGap(18)
						.addComponent(label_3, GroupLayout.PREFERRED_SIZE, 122,
								GroupLayout.PREFERRED_SIZE)
						.addPreferredGap(ComponentPlacement.RELATED,
								GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
						.addComponent(lblQValue, GroupLayout.PREFERRED_SIZE,
								56, GroupLayout.PREFERRED_SIZE)
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(QValue, GroupLayout.PREFERRED_SIZE, 109,
								GroupLayout.PREFERRED_SIZE).addGap(31)));
		gl_panel.setVerticalGroup(gl_panel
				.createParallelGroup(Alignment.LEADING)
				.addGroup(
						gl_panel.createSequentialGroup()
								.addGap(19)
								.addGroup(
										gl_panel.createParallelGroup(
												Alignment.TRAILING)
												.addComponent(
														QValue,
														GroupLayout.PREFERRED_SIZE,
														GroupLayout.DEFAULT_SIZE,
														GroupLayout.PREFERRED_SIZE)
												.addComponent(lblQValue)
												.addGroup(
														gl_panel.createParallelGroup(
																Alignment.LEADING,
																false)
																.addComponent(
																		initialTime,
																		Alignment.TRAILING,
																		GroupLayout.DEFAULT_SIZE,
																		24,
																		Short.MAX_VALUE)
																.addGroup(
																		gl_panel.createParallelGroup(
																				Alignment.TRAILING)
																				.addGroup(
																						gl_panel.createParallelGroup(
																								Alignment.BASELINE)
																								.addComponent(
																										label_4)
																								.addComponent(
																										label_1))
																				.addGroup(
																						gl_panel.createParallelGroup(
																								Alignment.BASELINE)
																								.addComponent(
																										label_5)
																								.addComponent(
																										label_2))
																				.addComponent(
																						iterationTime,
																						Alignment.LEADING,
																						GroupLayout.PREFERRED_SIZE,
																						GroupLayout.DEFAULT_SIZE,
																						GroupLayout.PREFERRED_SIZE))
																.addComponent(
																		label_3,
																		GroupLayout.PREFERRED_SIZE,
																		18,
																		GroupLayout.PREFERRED_SIZE)
																.addGroup(
																		gl_panel.createParallelGroup(
																				Alignment.TRAILING)
																				.addComponent(
																						totalTime,
																						GroupLayout.PREFERRED_SIZE,
																						GroupLayout.DEFAULT_SIZE,
																						GroupLayout.PREFERRED_SIZE)
																				.addComponent(
																						label))))
								.addContainerGap()));
		panel.setLayout(gl_panel);
		communityResult.setLayout(new BorderLayout(0, 0));
		setLayout(groupLayout);
	}

	public JTextPane getTotalTime() {
		return totalTime;
	}

	public void setTotalTime(JTextPane totalTime) {
		this.totalTime = totalTime;
	}

	public JTextPane getInitialTime() {
		return initialTime;
	}

	public void setInitialTime(JTextPane initialTime) {
		this.initialTime = initialTime;
	}

	public JTextPane getIterationTime() {
		return iterationTime;
	}

	public void setIterationTime(JTextPane iterationTime) {
		this.iterationTime = iterationTime;
	}

	public JTextPane getQValue() {
		return QValue;
	}

	public void setQValue(JTextPane qValue) {
		QValue = qValue;
	}

	public JPanel getCommunityResult() {
		return communityResult;
	}

	public void setCommunityResult(JPanel communityResult) {
		this.communityResult = communityResult;
	}
}
